package com.lanou.service.impl;

import com.lanou.bean.User;
import com.lanou.mapper.UserMapper;
import com.lanou.service.UserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;

/**
 * Created by dllo on 18/2/26.
 */
@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserMapper userMapper;

    @Override
    public User searchUser(@Param(value = "name") String name, @Param(value = "password") String password) {
        return userMapper.searchUser(name,password);
    }

    @Override
    public void addUser(@RequestParam(value = "name") String name, @RequestParam(value = "password") String password, @RequestParam(value = "tel") String tel, @RequestParam(value = "address") String address) {
        userMapper.addUser(name,password,tel,address);
    }

}
